.\"
.\" Copyright (C) 1994-2021 Altair Engineering, Inc.
.\" For more information, contact Altair at www.altair.com.
.\"
.\" This file is part of both the OpenPBS software ("OpenPBS")
.\" and the PBS Professional ("PBS Pro") software.
.\"
.\" Open Source License Information:
.\"
.\" OpenPBS is free software. You can redistribute it and/or modify it under
.\" the terms of the GNU Affero General Public License as published by the
.\" Free Software Foundation, either version 3 of the License, or (at your
.\" option) any later version.
.\"
.\" OpenPBS is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
.\" License for more details.
.\"
.\" You should have received a copy of the GNU Affero General Public License
.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
.\"
.\" Commercial License Information:
.\"
.\" PBS Pro is commercially licensed software that shares a common core with
.\" the OpenPBS software.  For a copy of the commercial license terms and
.\" conditions, go to: (http://www.pbspro.com/agreement.html) or contact the
.\" Altair Legal Department.
.\"
.\" Altair's dual-license business model allows companies, individuals, and
.\" organizations to create proprietary derivative works of OpenPBS and
.\" distribute them - whether embedded or bundled with other software -
.\" under a commercial license agreement.
.\"
.\" Use of Altair's trademarks, including but not limited to "PBS™",
.\" "OpenPBS®", "PBS Professional®", and "PBS Pro™" and Altair's logos is
.\" subject to Altair's trademark licensing policies.
.\"
.TH qmsg 1B "6 May 2020" Local "PBS Professional"
.SH NAME
.B qmsg 
- write message string into one or more job output files
.SH SYNOPSIS
.B qmsg
[-E] [-O] <message string>
<job ID> [<job ID> ...]
.br
.B qmsg
--version

.SH DESCRIPTION
Writes a message string into one or more output files of the job.
Typically this is done to leave an informative message in the output
of the job.  Also called "sending a message to a job".  

The 
.B qmsg
command writes messages into the files of jobs by sending a 
.I Message Job 
batch request to the batch server that owns the job.  The 
.B qmsg
command does not directly write the message into the files of the job.

The 
.B qmsg 
command can be used on jobs and subjobs, but not on job arrays or ranges of
subjobs.

.SH OPTIONS
.IP "-E" 8
The message is written to the standard error of each job.

.IP "-O" 8
The message is written to the standard output of each job.

.IP "--version" 8
The 
.B qmsg
command returns its PBS version information and exits.
This option can only be used alone.

.IP "(no options)" 8
The message is written to the standard error of each job.

.SH  OPERANDS
.IP "message string" 8
The message to be written. String.  First operand.  If the string contains
blanks, the string must be quoted.  If the final character of the string 
is not a newline, a newline character is added when written to the job's file.

.IP "job ID" 8
The job(s) to receive the message string.  This operand follows the 
.I message string
operand.  Can be a job or subjob.  Cannot be a job array or range of subjobs.  The 
.B qmsg 
command accepts one or more
.I job ID
operands.
.br
Format for job:
.br
.I <sequence number>[.<server name>][@<server name>]
.br
Format for subjob. Note that a subjob has square brackets around its index number:
.br
.I <sequence number>[<index>][.<server name>][@<server name>]

.SH STANDARD ERROR
The 
.B qmsg
command writes a diagnostic message to standard error for
each error occurrence.

.SH EXIT STATUS
.IP Zero 8
Upon success
.IP "Greater than zero" 8
Upon failure

.SH SEE ALSO
qsub(1B), pbs_msgjob(3B)
